import $ from 'jquery'
/*设置本地存储*/
const t = localStorage.currentUser
  ? JSON.parse(localStorage.currentUser).token : "";
export default function (url,data,f,e) {
  $.ajax({
    type : "POST",
    // url : "http://47.96.26.190:8080/"+url,
      url : "http://localhost:8080/"+url,
    // url: 'http://47.98.200.7:8080/' + url,
    //添加响应头
    headers:{
      "Content-Type": "application/json;charset=UTF-8",
      "Authorization": "SANGE " + t
    },

    data : JSON.stringify(data),
    //dataType : "json",
    success : f,
    fail: function (data) {
      console.log(data.status);
    },
    error: e ? e : function (data) {
      if (data.status == 403) {

      }


    }
  });
}
